home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
U-Utilities
/
(c)u2.d64
/
tiny directory.c
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2007-02-04
|
2KB
|
60 lines
100 REM "TINY DIRECTORY"
110 REM PRINTS A TINY 2-COLUMN (null) ON A GEMINI PRINTER
120 REM MODIFIED BY R.B. WOLFF
130 :
140 XX=0
150 ESC$=CHR$(27)
160 PRINT "[147]PRINT A TINY 2-COLUMN DIRECTORY"
170 IF XX<>0 THEN 200
180 INPUT "[144]IS THE PRINTER ON (Y[146]/N[146]) Y[157][157][157]"; A$
190 IF A$<>"Y" THEN PRINT "[145][145]";: GOTO 180
200 DIM N$(144): REM LISTS UP TO 144 FILES ON DISK
210 OPEN 15,8,15
220 OPEN 4,4
230 PRINT#4, ESC$CHR$(64);: REM RESET PRINTER ESC @
240 PRINT#4, ESC$CHR$(66)CHR$(3);: REM SETS 17 CPI ESC B 3
250 PRINT#4, ESC$CHR$(83)CHR$(1);: REM SUBSRIPT MODE IS SELECTED ESC S 1
260 PRINT#4, ESC$CHR$(86)CHR$(1);: REM ??? ESC V 1
270 PRINT#4, ESC$CHR$(65)CHR$(6);: REM CHANGE LINE FEED TO 6/72" (1/12") ESC A 6
280 PRINT "[155]INSERT A DISK IN DRIVE AND"
290 PRINT "THEN PRESS ANY KEY[154]"
300 GET A$: IF A$="" THEN 300
310 PRINT "[147]";
320 PRINT#15, "I"
330 CT=0: REM CT IS THE COUNT OF THE NUMBER OF DISK FILES
340 OPEN 2,8,0,"$0:*"
350 GET#2, A$,A$
360 GET#2, A$,A$,A$,B$
370 A=ASC(A$+CHR$(0))+256*ASC(B$+CHR$(0)): REM CALC FILE SIZE
380 IF ST THEN 530
390 L$=""
400 IF CT THEN L$=MID$(STR$(A)+" ",2,3)
410 GET#2, A$
420 IF NOT(A$=CHR$(34) OR A$="B") THEN 410: REM SEARCH FOR " OR B
430 [137] 460
440 [161]#2, A$: [139] A$[178]"" [167] 470
450 [139] ([198](A$)[175]127)[179]32 [167] 440
455 [139] [198](A$)[177]192 [167] A$[178][199]([198](A$)[171]128): [143] CONVERT TO COMMODORE UPPERCASE
460 L$[178]L$[170]A$: [137] 440: [143] FORM NEXT FILENAME
470 L$[178][200](L$,25): [143] TRUNCATE TO AT MOST 25 CHARACTERS
480 N$(CT)[178]L$: [143] PUT FILENAME IN NAME ARRAY
490 [139] CT[178]0 [167] [153] "";L$;"WAIT": [137] 510: [143] PUT DISK ID IN REVERSE VIDEO
500 [153] L$: [143] LIST FILENAME ON SCREEN
510 CT[178]CT[170]1
520 [137] 360
530 [152]4, "";N$(0): [143] PRINT [208] INFO
540 CT[178]CT[171]1: [143] ADD FREE BLOCKS TO PRINT OUT
550 N$(CT)[178][200](N$(CT),3)[170]" "[170][202](N$(CT),4): [143] PUT BLANK IN FREE BLOCK COUNT
560 MID[178][181](CT[173]2)
570 [129] I[178]1 [164] MID: [152]4, N$(I)" "N$(I[170]MID): [130]
580 [139] CT[179][177]2[172][181](CT[173]2) [167] [152]4, [163]28);N$(CT): [143] CASE WHEN CT IS ODD
590 [152]4, " "
600 [152]4, ESC$[199](64): [143] RESET PRINTER ESC @
610 [152]4, " "
620 [160] 2
630 [153] "LISTDO YOU WANT TO PRINT ANOTHER"
640 [133] "DIRECTORY (YWAIT/NWAIT) YCMDCMDCMD"; A$
650 [139] A$[178]"Y" [167] [156]: XX[178]1: [137] 150
660 [153] "CONTLOAD"
670 [128]